Skip to content

KAFKA-20642: Support character ranges in Kafka shell globs#22430

Open
Russole wants to merge 2 commits into
apache:trunkfrom
Russole:KAFKA-20642
Open

KAFKA-20642: Support character ranges in Kafka shell globs#22430
Russole wants to merge 2 commits into
apache:trunkfrom
Russole:KAFKA-20642

Conversation

@Russole
Copy link
Copy Markdown

@Russole Russole commented May 31, 2026

This PR addresses the TODO in GlobComponent to handle character ranges
in Kafka shell glob components.

TODO Link:

GlobComponent already supports *, ?, and {a,b} patterns, but
character classes were not handled. This change translates glob
character classes into Java regular expression character classes,
including ranges and negated classes such as [0-9], [abc], [!abc],
and [^abc].

Malformed character classes such as unterminated or empty classes are
rejected consistently with other malformed glob patterns.

Unit tests were added in GlobComponentTest for regex translation,
matching behavior, and malformed character classes. I also ran
./gradlew :shell:test --tests org.apache.kafka.shell.glob.GlobComponentTest.

@github-actions github-actions Bot added triage PRs from the community tools small Small PRs labels May 31, 2026
@Russole
Copy link
Copy Markdown
Author

Russole commented May 31, 2026

Hi @chia7712 , could you please take a look when you have time? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

small Small PRs tools triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant